<template>
    <view class="container">
        <page-render
            @__l="__l"
            :page="page"
            theme="default"
            vueId="acb98364-1"
            v-if="(isInit && type == 'renyi') || type == 'fudai' || type == 'chip' || type == 'box' || type == 'yifanshang'"
        ></page-render>
        <view class="content" v-else>
            <view class="head">
                <view class="haoyou">
                    <button class="share-btn" openType="share"></button>
                </view>
                <view class="haibao">
                    <button @tap="__e" class="poster-btn" :data-event-opts="[['tap', [['handlePosterImg', ['$event']]]]]"></button>
                </view>
            </view>
            <image class="rightIcon" src="https://img121.7dun.com/yuanqimali/ruleTuiJian/rightIcon.png"></image>
            <view class="cent">
                <view class="cent-up">
                    <view class="cent-headimg">
                        <image :src="userInfo.headimg"></image>
                    </view>
                    <view class="cent-title">{{ '' + title + '' }}</view>
                    <view @tap="__e" class="cent-chaxun" :data-event-opts="[['tap', [['goinvite', ['$event']]]]]">
                        <image src="https://img121.7dun.com/yuanqimali/ruleTuiJian/shouyichaxun.png"></image>
                    </view>
                </view>
                <view class="cent-down">
                    <view class="cent-down-fl">
                        <view class="cent-direct">{{ '' + direct_inviter + '' }}</view>
                        <view class="cent-direct-title">直接邀请人(人)</view>
                    </view>
                    <view class="cent-down-fl">
                        <view class="cent-direct">{{ '' + indirect_inviter + '' }}</view>
                        <view class="cent-direct-title">间接邀请人(人)</view>
                    </view>
                    <view class="cent-down-fr">
                        <view class="cent-all">{{ '' + all_money + '' }}</view>
                        <view class="cent-all-title">推荐收益(元)</view>
                    </view>
                </view>
            </view>
            <view class="dengjiguize">
                <image src="https://img121.7dun.com/yuanqimali/ruleTuiJian/dengjiguize.png"></image>
            </view>
            <view class="xinrendingyi">
                <image class="xinrendingyi-img" src="https://img121.7dun.com/yuanqimali/ruleTuiJian/xinrendingyi.png"></image>
                <image class="leftIcon" src="https://img121.7dun.com/yuanqimali/ruleTuiJian/leftIcon.png"></image>
            </view>
            <share-popup
                @__l="__l($event, { eventOpts: [['^close', [['e0']]]] })"
                @close="__e($event, { eventOpts: [['^close', [['e0']]]] })"
                :data-event-opts="[['^close', [['e0']]]]"
                :info="posterInfo"
                vueId="acb98364-2"
                v-if="showShare"
            ></share-popup>
        </view>
    </view>
</template>

<script>
import pageRender from '@/components/PageRender/PageRender';
import sharePopup from '@/components/SharePopup/SharePopup';
import posterTheme1 from '@/components/SharePopup/components/posterTheme1';
import tabBar from '@/components/TabBar/tabBar';
(global.webpackJsonp = global.webpackJsonp || []).push([
    ['pages/rule/index'],
    {
        '070d': function (e, n, t) {
            'use strict';

            t.r(n);
            var o = t('22ee');
            var i = t('e5be');
            for (var r in i) {
                if (['default'].indexOf(r) < 0) {
                    (function (e) {
                        t.d(n, e, function () {
                            return i[e];
                        });
                    })(r);
                }
            }
            t('90e3');
            var a = t('f0c5');
            var u = Object(a.a)(i.default, o.b, o.c, false, null, null, null, false, o.a, void 0);
            n.default = u.exports;
        },
        '0a18': function (e, n, t) {},
        '22ee': function (e, n, t) {
            'use strict';

            t.d(n, 'b', function () {
                return i;
            });
            t.d(n, 'c', function () {
                return r;
            });
            t.d(n, 'a', function () {
                return o;
            });
            var o = {
                PageRender: function () {
                    return Promise.all([t.e('common/vendor'), t.e('components/PageRender/PageRender')]).then(t.bind(null, 'b4aa'));
                },
                SharePopup: function () {
                    return Promise.all([t.e('common/vendor'), t.e('components/SharePopup/SharePopup')]).then(t.bind(null, 'b677'));
                }
            };
            var i = function () {
                var that = this;
                that.$createElement;
                that._self._c;
                that._isMounted ||
                    (that.e0 = function (n) {
                        that.showShare = false;
                    });
            };
            var r = [];
        },
        '22f2': function (e, n, t) {
            'use strict';

            (function (e, n) {
                var o = t('4ea4');
                t('18ba');
                o(t('66fd'));
                var i = o(t('070d'));
                e.__webpack_require_UNI_MP_PLUGIN__ = t;
                n(i.default);
            }.call(this, t('bc2e').default, t('543d').createPage));
        },
        '90e3': function (e, n, t) {
            'use strict';

            var o = t('0a18');
            t.n(o).a;
        },
        '9b1f': function (e, n, t) {
            'use strict';

            (function (e) {
                Object.defineProperty(n, '__esModule', {
                    value: true
                });
                n.default = void 0;
                var o = t('b5e5');
                var i =
                    (t('2684'),
                    {
                        components: {
                            PosterTheme1: function () {
                                Promise.all([t.e('common/vendor'), t.e('components/SharePopup/components/posterTheme1')])
                                    .then(
                                        function () {
                                            return resolve(t('04ac'));
                                        }.bind(null, t)
                                    )
                                    .catch(t.oe);
                            },
                            SharePopup: function () {
                                Promise.all([t.e('common/vendor'), t.e('components/SharePopup/SharePopup')])
                                    .then(
                                        function () {
                                            return resolve(t('b677'));
                                        }.bind(null, t)
                                    )
                                    .catch(t.oe);
                            }
                        },
                        name: 'rule',
                        data: function () {
                            return {
                                isInit: false,
                                type: '',
                                page: {},
                                canvasStatus: false,
                                sharerInfo: {},
                                all_money: 0,
                                userInfo: (0, o.getStorageSync)('userInfo') || {},
                                showShare: false,
                                title: '初级推荐官',
                                direct_inviter: 0,
                                indirect_inviter: 0
                            };
                        },
                        computed: {
                            posterInfo: function () {
                                var e = this.$store.getters.userInfo || {};
                                var n = this.getShareConfig(false);
                                return {
                                    path: '/pages/index/index?type=share&&inviter=' + e.uuid,
                                    app_url: n.app_url,
                                    thumb: 'https://img121.7dun.com/yuanqimali/share/posterImg.png'
                                };
                            }
                        },
                        watch: {},
                        created: function () {
                            e.loadFontFace({
                                family: 'BebasNeue',
                                source: 'url("https://img121.7dun.com/newRecommend2/BebasNeue-1.otf")',
                                success: function () {
                                    console.log('success');
                                }
                            });
                        },
                        onLoad: function (e) {
                            this.type = e.type;
                            this.initData();
                            this.getDistribution();
                        },
                        methods: {
                            tograde: function () {
                                e.pageScrollTo({
                                    scrollTop: 800,
                                    duration: 300
                                });
                            },
                            initData: function () {
                                var that = this;
                                this.$http('/setting/' + this.type + '_rule').then(function (n) {
                                    that.page = n.data.setting;
                                    that.isInit = true;
                                });
                            },
                            close: function () {
                                this.showShare = false;
                                this.$emit('close');
                            },
                            saveImg: function () {
                                e.downloadFile({
                                    url: 'https://img121.7dun.com/member_grade/peipeiOnline.jpg',
                                    success: function (n) {
                                        e.showToast({
                                            title: '已保存到相册',
                                            icon: 'none'
                                        });
                                    }
                                });
                            },
                            handlePosterImg: function () {
                                this.showShare = true;
                            },
                            getDistribution: function () {
                                var that = this;
                                this.$http('/agent/brokerage').then(function (n) {
                                    that.sharerInfo = n.data;
                                    that.all_money = n.data.all.money / 100;
                                    that.title = n.data.now_agent_level;
                                    that.direct_inviter = n.data.direct_inviter;
                                    that.indirect_inviter = n.data.indirect_inviter;
                                });
                            },
                            goinvite: function () {
                                e.navigateTo({
                                    url: '/pages/myInvitees/index'
                                });
                            }
                        }
                    });
                n.default = i;
            }.call(this, t('543d').default));
        },
        e5be: function (e, n, t) {
            'use strict';

            t.r(n);
            var o = t('9b1f');
            var i = t.n(o);
            for (var r in o) {
                if (['default'].indexOf(r) < 0) {
                    (function (e) {
                        t.d(n, e, function () {
                            return o[e];
                        });
                    })(r);
                }
            }
            n.default = i.a;
        }
    },
    [['22f2', 'common/runtime', 'common/vendor']]
]);
</script>
<style>
@import './index.css';
</style>
